﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Web;

namespace QD.UrlRewriter
{
    public class FormFixerHtml32TextWriter : System.Web.UI.Html32TextWriter
    {
        private string _url;

        public FormFixerHtml32TextWriter(TextWriter writer)
            : base(writer)
        {
            _url = HttpContext.Current.Request.RawUrl;

        }

        public override void WriteAttribute(string name, string value, bool encode)
        {
            if ((this._url != null) && (string.Compare(name, "action", true) == 0))
            {
                value = this._url;
            }
            base.WriteAttribute(name, value, encode);
        }



    }

}
